From 27053ad40121adcf08603c7d7c9c3f48af5246f5 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Thu, 12 Jun 2025 22:25:57 +0200 Subject: Initial page works --- src/pages/blog/[slug].astro | 67 --------------------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 src/pages/blog/[slug].astro (limited to 'src/pages/blog/[slug].astro') diff --git a/src/pages/blog/[slug].astro b/src/pages/blog/[slug].astro deleted file mode 100644 index f42f5c9..0000000 --- a/src/pages/blog/[slug].astro +++ /dev/null @@ -1,67 +0,0 @@ ---- -import { getCollection, getEntry } from 'astro:content'; -import StandardLayout from '../../layouts/StandardLayout.astro'; - -// Define the props type -export async function getStaticPaths() { - const blogEntries = await getCollection('blog'); - return blogEntries.map(entry => ({ - params: { slug: entry.slug }, - props: { entry }, - })); -} - -// Get the blog post data -const { entry } = Astro.props; -const { Content } = await entry.render(); - -// Format the publication date -const formattedDate = new Date(entry.data.pubDate).toLocaleDateString('en-US', { - year: 'numeric', - month: 'long', - day: 'numeric' -}); ---- - - -
- - - {entry.data.image && ( - {entry.data.title} - )} - -

{entry.data.title}

- -
- By {entry.data.author} - • - -
- - {entry.data.tags && entry.data.tags.length > 0 && ( -
- {entry.data.tags.map(tag => ( - - {tag} - - ))} -
- )} - -
- -
-
-
-- cgit v1.3.1